package com.qfmy.webapp.controller.user;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.user.SignInRecordVo;
import com.qfmy.webapp.service.user.SignInRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.webapp.controller.user
 * @date 2025/11/26
 * @description 签到记录表
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/signInRecord")
public class SignInRecordController {

    /**
     * 注入签到记录表服务
     */
    @Autowired
    private SignInRecordService signInRecordService;

    /**
     * 获取用户签到纪录
     */
    @RequestMapping("/getUserSignInRecord")
    public Result<SignInRecordVo> getUserSignInRecord() {
         SignInRecordVo signInRecordVo = signInRecordService.getUserSignInRecord();
         return Result.ok(signInRecordVo);
    }

    /**
     * 进行签到
     */
    @RequestMapping("/signIn")
    public Result<String> signIn(@RequestParam Integer coin) {
        signInRecordService.signIn(coin);
        return Result.ok("成功签到");
    }

}
